Method, system and terminal for generating verification template

ABSTRACT

The present disclosure provides a method for generating a verification template. The verification template includes an infrared template and a depth template. The method includes: obtaining an infrared image of a target object and storing the infrared image into a trusted execution environment as the infrared template; controlling a laser projector to project laser light to the target object; obtaining a laser pattern modulated by the target object; and processing the laser pattern to obtain a depth image and storing the depth image into the trusted execution environment as the depth template.

CROSS-REFERENCE TO RELATED APPLICATION(S)

This application is a 371 application of International Application No.PCT/CN2019/084326, filed on Apr. 25, 2019, which claims priority toChinese Patent Application Serial No. 201810529884.8, filed on May 29,2018, the entire content of both of which are incorporated herein byreference in their entireties.

TECHNICAL FIELD

The present disclosure relates to a field of information securitytechnology, and more particularly to a method and a system forgenerating a verification template, a terminal, a non-transitorycomputer readable storage medium, and a computer device.

BACKGROUND

In the related art, an electronic device generally verifies whether ause has a relevant usage right by comparing a difference between a faceimage input by the user and a pre-stored face image template.

SUMMARY

Embodiments of the present disclosure provide a method for generating averification template, a system for generating a verification template,a terminal, a non-transitory computer readable storage medium, andcomputer device.

The verification template according to embodiments of the presentdisclosure includes an infrared template and a depth template. Themethod for generating the verification template includes: obtaining aninfrared image of a target object, and storing the infrared image into atrusted execution environment as the infrared template; controlling alaser projector to project laser light to the target object; obtaining alaser pattern modulated by the target object; and processing the laserpattern to obtain a depth image, and storing the depth image into thetrusted execution environment as the depth template.

The system for generating the verification template according toembodiments of the present disclosure includes a microprocessor and anapplication processor. The microprocessor is configured to: obtain aninfrared image of a target object, and store the infrared image into atrusted execution environment as the infrared template; control a laserprojector to project laser light to the target object; obtain a laserpattern modulated by the target object; and process the laser pattern toobtain a depth image, and store the depth image into the trustedexecution environment as the depth template.

The terminal for generating a verification template according toembodiments of the present disclosure includes an infrared camera, alaser projector, a microprocessor and an application processor. Theinfrared camera is configured to collect an infrared image of a targetobject. The laser projector is configured to project laser light to thetarget object. The microprocessor is configured to: obtain the infraredimage of the target object, and store the infrared image into a trustedexecution environment; control the laser projector to project the laserlight to the target object as the infrared template; obtain a laserpattern modulated by the target object; and process the laser pattern toobtain a depth image, and store the depth image into the trustedexecution environment as the depth template.

One or more non-transitory computer readable storage medium containingcomputer executable instructions according to embodiments of the presentdisclosure, when the computer executable instructions are executed byone or more processors, causes the processors to perform the method forgenerating a verification template according to embodiments of thepresent disclosure.

The computer device according to embodiments of the present disclosureincludes a memory and a processor. The memory has computer readableinstructions stored thereon, when the computer readable instructions areexecuted by the processor, causing the processor to perform the methodfor generating a verification template according to embodiments of thepresent disclosure.

Additional aspects and advantages of embodiments of present disclosurewill be given in part in the following descriptions, become apparent inpart from the following descriptions, or be learned from the practice ofthe embodiments of the present disclosure.

BRIEF DESCRIPTION OF DRAWINGS

These and other aspects and advantages of embodiments of the presentdisclosure will become apparent and more readily appreciated from thefollowing descriptions made with reference to the drawings, in which:

FIG. 1 is a flow chart of a method for generating a verificationtemplate according to an embodiment of the present disclosure;

FIG. 2 is a schematic diagram illustrating structure of a terminalaccording to an embodiment of the present disclosure;

FIG. 3 is a block diagram illustrating a terminal according to anembodiment of the present disclosure;

FIG. 4 is a flow chart of a method for generating a verificationtemplate according to an embodiment of the present disclosure;

FIG. 5 is a flow chart of a method for generating a verificationtemplate according to an embodiment of the present disclosure;

FIG. 6 is a block diagram illustrating a computer readable storagemedium and a processor according to an embodiment of the presentdisclosure;

FIG. 7 is a block diagram illustrating a computer device according to anembodiment of the present disclosure;

FIG. 8 is a schematic diagram illustrating structure of a laserprojector according to an embodiment of the present disclosure;

FIGS. 9 to 11 are schematic diagrams illustrating portion structure of alaser projector according to embodiments of the present disclosure.

DETAILED DESCRIPTION

Reference will be made in detail to embodiments of the presentdisclosure. Examples of the embodiments of the present disclosure willbe shown in drawings, in which the same or similar elements and theelements having same or similar functions are denoted by like referencenumerals throughout the descriptions. The embodiments described hereinaccording to drawings are explanatory and illustrative, not construed tolimit the present disclosure.

However, the face image template is easy to be tampered or stolen,resulting in lower security of information within the electronic device.

Therefore, embodiments of the present disclosure provide a method forgenerating a verification template, a system for generating averification template, a terminal, a non-transitory computer readablestorage medium, and computer device.

A verification template according to embodiments of the presentdisclosure includes an infrared template and a depth template. A methodfor generating a verification template includes: obtaining an infraredimage of a target object, and storing the infrared image into a trustedexecution environment as the infrared template; controlling a laserprojector to project laser light to the target object; obtaining a laserpattern modulated by the target object; and processing the laser patternto obtain a depth image, and storing the depth image into the trustedexecution environment as the depth template.

In some embodiments, the method further includes: obtaining a colorimage of the target object, and storing the color image into a richexecution environment; and obtaining the color image from the richexecution environment, and controlling a display screen to display thecolor image.

In some embodiments, obtaining the laser pattern modulated by the targetobject includes obtaining a plurality of laser pattern frames modulatedby the target object. Processing the laser pattern to obtain the depthimage includes processing each of the plurality of laser pattern framesto obtain a plurality of initial depth image frames and combining theplurality of initial depth image frames to obtain the depth image.

In some embodiments, the plurality of initial depth image frames areobtained from a plurality of different angles.

In some embodiments, codes and a memory area in the trusted executionenvironment are controlled by an access control unit, and areinaccessible to programs in the rich execution environment.

A system for generating a verification template according to embodimentsof the present disclosure includes a microprocessor and an applicationprocessor. The microprocessor is configured to: obtain an infrared imageof a target object, and store the infrared image into a trustedexecution environment as the infrared template; control a laserprojector to project laser light to the target object; obtain a laserpattern modulated by the target object; and process the laser pattern toobtain a depth image, and store the depth image into the trustedexecution environment as the depth template.

In some embodiments, the application processor is configured to: obtaina color image of the target object, and store the color image into arich execution environment; and obtain the color image from the richexecution environment, and control a display screen to display the colorimage.

In some embodiments, the microprocessor is configured to: obtain aplurality of laser pattern frames modulated by the target object;process each of the plurality of laser pattern frames to obtain aplurality of initial depth image frames; and combine the plurality ofinitial depth image frames to obtain the depth image.

In some embodiments, the microprocessor is coupled to the trustedexecution environment via a mobile industry processor interface (MIPI).

A terminal for generating a verification template according to anembodiment of the present disclosure includes an infrared camera, alaser projector, a microprocessor and an application processor Theinfrared camera is configured to collect an infrared image of a targetobject. The laser projector is configured to project laser light to thetarget object. The microprocessor is configured to: obtain the infraredimage of the target object, and store the infrared image into a trustedexecution environment as the infrared template; control the laserprojector to project the laser light to the target object; obtain alaser pattern modulated by the target object; and process the laserpattern to obtain a depth image, and store the depth image into thetrusted execution environment as the depth template.

One or more non-transitory computer readable storage medium containingcomputer executable instructions according to an embodiment of thepresent disclosure, when the computer executable instructions areexecuted by one or more processors, causes the processors to perform themethod for generating a verification template according to any one ofabove embodiments.

A computer device according to an embodiment of the present disclosureincludes a memory and a processor. The memory has computer readableinstructions stored thereon, when the computer readable instructions areexecuted by the processor, causing the processor to perform the methodfor generating a verification template according to any one of aboveembodiments.

With the method for generating a verification template, the system forgenerating a verification template, the terminal, the non-transitorycomputer readable storage medium, and the computer device, both theobtained infrared template and the obtained depth template are stored inthe trusted execution environment, the verification template in thetrusted execution environment is not easy to be tampered and stolen, andsecurity of the information in the terminal is relatively high.

In the following, the verification method, the verification device andthe electronic device will be described in detail with reference to thedrawings.

As illustrated in FIG. 1, the embodiments of the present disclosureprovide a method for generating a verification template. Theverification template includes an infrared template and a depthtemplate. The method for generating the verification template includesthe following actions.

At block 01, an infrared image of a target object is obtained, and theinfrared image is stored into a trusted execution environment as theinfrared template.

At block 02, a laser projector is controlled to project laser light tothe target object.

At block 03, a laser pattern modulated by the target object is obtained.

At block 04, the laser pattern is processed to obtain a depth image, andthe depth image is stored into the trusted execution environment as thedepth template.

As illustrated in FIG. 2 and FIG. 3, a terminal 100 according to anembodiment of the present disclosure includes an infrared camera 10, alaser projector 20, and the system 50 for generating a verificationtemplate. The infrared camera 10 may be configured to collect theinfrared image of the target object. The laser projector 20 isconfigured to project the laser light to the target object. The system50 for generating a verification template is configured to implement themethod for generating a verification template. The system 50 forgenerating a verification template may include an application processor(AP) 51 and a microprocessor 52. The application processor 51 is formedwith the trusted execution environment (TEE) 511. The microprocessor 52may be configured to implement above actions at blocks 01, 02, 03 and04. That is, the microprocessor 52 may be configured to obtain theinfrared image of the target object, to store the infrared image intothe trusted execution environment 511 of the application processor 51 asthe infrared template, to control the laser projector 20 to project thelaser light to the target object, to obtain the laser pattern modulatedby the target object, to process the laser pattern to obtain the depthimage, and to store the depth image into the trusted executionenvironment 511 as the depth template.

The verification template refers to a reference, input to the terminal100 by a user in advance, for comparing a verification element inputsubsequently. When a similarity between the verification element inputsubsequently and the verification template is greater than a presetvalue, it is determined that the verification is successful, otherwise,the verification is failed. In an embodiment of the present disclosure,the verification template includes the infrared template and the depthtemplate. The infrared template may be a face infrared image of a user,and the face infrared image may be a flat image. The depth template maybe a face depth image of the user. The depth image may be obtained bymeans of structured light detection. During an actual verificationprocess, an infrared image of a scene before the terminal 100 may beobtained, and the infrared image of the scene before the terminal 100may be compared with the infrared template to determine whether a faceimage matched with the face infrared image exists in the infrared imageof the scene before the terminal 100. Further, after the verification ofthe infrared template is successful, a depth image of the scene beforethe terminal 100 is obtained, and the depth image of the scene beforethe terminal 100 is compared with the depth template to determinewhether a face image matched with the face depth image in the depthtemplate exists in the depth image of the scene before the terminal 100.After the user passes the verification, relevant operation authorities,such as unlocking the screen, payment, etc., at the terminal 100 areobtained.

As illustrated in FIG. 2 and FIG. 3, the terminal 100 may be a mobilephone, a tablet computer, a smart watch, a smart bracelet, a smartwearable device, and the like. In an embodiment of the presentdisclosure, for example, the terminal 100 is the mobile phone. It can beunderstood that, a specific form of the terminal 100 is not limited tothe mobile phone. The infrared image of the target object may becollected by the infrared camera 10. The infrared camera 10 may becoupled to the application processor 51. The application processor 51may be configured to control the power of the infrared camera 10 toswitch on or off, to power down the infrared camera 10, or to reset theinfrared camera 10. At the same time, the infrared camera 10 may also becoupled to the microprocessor 52. The microprocessor 52 and the infraredcamera 10 may be coupled to each other via an inter-integrated circuit(I2C) bus 70. The microprocessor 52 may provide the infrared camera 10with clock information for collecting the infrared image. The infraredimage collected by the infrared camera 10 may be transmitted to themicroprocessor 52 via a mobile industry processor interface (MIPI) 521.In an embodiment of the present disclosure, the terminal 100 may furtherinclude an infrared fill lamp 40. The infrared fill lamp 40 may beconfigured to emit infrared light. The infrared light is reflected bythe user and then received by the infrared camera 10. The infrared filllamp 40 may be coupled to the application processor 51 via theinter-integrated circuit bus. The application processor 51 may beconfigured to enable the infrared fill lamp 40. The infrared fill lamp40 may also be coupled to the microprocessor 52. In detail, the infraredfill lamp 40 may be coupled to a pulse width modulation (PWM) interface522 of the microprocessor 52.

The laser projector 20 of the terminal 100 may project laser light tothe target object. The laser projector 20 may be coupled to theapplication processor 51. The application processor 51 may be configuredto enable the laser projector 20 and be coupled to the laser projector20 via the inter-integrated circuit bus 70. The laser projector 20 mayalso be coupled to the microprocessor 52. In detail, the laser projector20 may be coupled to the pulse width modulation interface 522 of themicroprocessor 52.

The microprocessor 52 may be a processing chip. The microprocessor 52 iscoupled to the application processor 51. In detail, the applicationprocessor 51 may be configured to reset the microprocessor 52, to wakeup the microprocessor 52, to debug the microprocessor 52, and the like.The microprocessor 52 may be coupled to the application processor 51 viathe mobile industry processor interface 521. In detail, themicroprocessor 52 is coupled to the trusted execution environment 511 ofthe application processor 51 via the mobile industry processor interface521 and to directly transmit data in the microprocessor 52 to thetrusted execution environment 511 for storage. Codes and a memory areain the trusted execution environment 511 are controlled by an accesscontrol unit and are inaccessible to programs in the rich executionenvironment 512. Both the trusted execution environment 511 and the richexecution environment 512 may be formed in the application processor 51.

The microprocessor 52 may obtain the infrared image by receiving theinfrared image collected by the infrared camera 10. The microprocessor52 may transmit the infrared image to the trusted execution environment511 via the mobile industry processor interface 521. The infrared imageoutput by the microprocessor 52 may not enter the rich executionenvironment 512 of the application processor 51, thus the infrared imagemay not be obtained by other program, improving the information securityof the terminal 100. The infrared image stored in the trusted executionenvironment 511 may be taken as the infrared template.

After the microprocessor 52 controls the laser projector 20 to projectthe laser light to the target object, the microprocessor 52 may furthercontrol the infrared camera 10 to collect the laser pattern modulated bythe target object. Then the microprocessor 52 obtains the laser patternvia the mobile industry processor interface 521. The microprocessor 52processes the laser pattern to obtain a depth image. In detail,calibration information of the laser light projected by the laserprojector 20 may be stored in the microprocessor 52. The microprocessor52 obtains the depth information at different positions of the targetobject by processing the laser pattern and the calibration information,and the depth image is formed. After the depth image is obtained, thedepth image is transmitted to the trusted execution environment 511 viathe mobile industry processor interface 521. The depth image stored inthe trusted execution environment 511 may be taken as the depthtemplate.

In conclusion, in the method for generating a verification template andthe terminal 100 according to the embodiments of the present disclosure,both the obtained infrared template and the obtained depth template arestored in the trusted execution environment 511, the verificationtemplate in the trusted execution environment 511 is not easy to betampered and stolen, and the security of the information in the terminal100 is relatively high.

As illustrated in FIG. 2 to FIG. 4, in some embodiments, the method forgenerating a verification template may further include the followingactions.

At block 05, a color image of the target object is obtained, and thecolor image is stored into the rich execution environment 512.

At block 06, the color image is obtained from the rich executionenvironment 512, and a display screen 60 is controlled to display thecolor image.

In some embodiments, the application processor 51 may be configured toimplement actions at blocks 05 and 06. That is, the applicationprocessor 51 may be configured to obtain the color image of the targetobject, to store the color image into the rich execution environment512, to obtain the color image from the rich execution environment 512,and to control the display screen 60 to display the color image.

In detail, the terminal 100 may further include a visible camera 30. Thevisible camera 30 is coupled to the application processor 51. In detail,the visible camera 30 may be coupled to the application processor 51 viathe inter-integrated circuit interface 70 or the mobile industryprocessor interface 521. The application processor 51 may be configuredto enable the visible camera 30, to power down the visible camera 30, orto reset the visible camera 30. The visible camera 30 may be configuredto collect the color image. The application processor 51 may obtain thecolor image from the visible camera 30 via the mobile industry processorinterface 521, and may store the color image to the rich executionenvironment 512. Data stored in the rich execution environment 512 maybe acquired by other program. In an embodiment of the presentdisclosure, the color image may be obtained by the application processor51, and may be displayed on the display screen 60 of the terminal 100.The visible camera 30 and the infrared camera 10 may worksimultaneously. Obtaining the color image by the application processor51 and obtaining the laser pattern by the microprocessor 52 may beimplemented simultaneously. The user may adjust orientation of the headby observing the color image displayed in the display screen 60 tofacilitate the infrared camera 10 to obtain a more accurate face imageor laser pattern.

As illustrated in FIG. 2, FIG. 3, and FIG. 5, in some embodiments, theaction at block 03 may include an action at block 031.

At block 031, a plurality of laser pattern frames modulated by thetarget object are obtained.

The action at block 04 may include the following actions.

At block 041, each of the plurality of laser pattern frames is processedto obtain a plurality of initial depth image frames.

At block 042, the plurality of initial depth image frames is combined toobtain the depth image.

In some embodiments, the actions at blocks 031, 041, and 042 may beimplemented by the microprocessor 52. That is, the microprocessor 52 maybe configured to obtain the plurality of the laser pattern framesmodulated by the target object, to process each of the plurality oflaser pattern frames to obtain the plurality of initial depth imageframes, and to combine the plurality of the initial depth image framesto obtain the depth image.

In detail, the final depth image regarded as the depth template may beobtained by combining a plurality of initial depth image frames ofuser's face obtained at a plurality of different angles. The pluralityof initial depth image frames may be obtained by processing theplurality of laser pattern frames, and the plurality of laser patternframes may be obtained when the head of user swings to different angles.For example, the head of the user may perform swing action such as leftswing, right swing, up swing, and down swing under guidance of thedisplay content of the display screen 60. During the swing process, thelaser projector 20 may project the laser light to the user's facecontinuously. The infrared camera 10 collects the plurality of laserpattern frames modulated by the target object. The microprocessor 20obtains the plurality of laser pattern frames and processes theplurality of laser pattern frames to obtain the plurality of initialdepth image frames. The microprocessor 20 processes the plurality ofinitial depth image frames to obtain the final depth image. The finaldepth image includes the depth information at different angles such asfront, left, right, and lower sides of the user's face. Thus, when theuser is required to be verified, the user's face at different angles maybe obtained and be compared with the depth template, instead ofrequiring the user to align the infrared camera 10 strictly according toa certain angle, shortening verification time of the user.

As illustrated in FIG. 6, the embodiments of the present disclosure mayfurther provide a computer readable storage medium 200. One or morenon-transitory computer readable storage medium 200 contains computerexecutable instructions 202. When the computer executable instructions202 are executed by one or more processors 300, the processors 300 arecaused to perform the method for generating a verification templateaccording to any one of the above embodiments. For example, thefollowing actions may be implemented. At block 01, an infrared image ofa target object is obtained, and the infrared image is stored into atrusted execution environment 511 as the infrared template. At block 02,a laser projector 20 is controlled to project laser light to the targetobject. At block 03, a laser pattern modulated by the target object isobtained. At block 04, the laser pattern is processed to obtain a depthimage, and the depth image is stored into the trusted executionenvironment 511 as the depth template.

As illustrated in FIG. 7, the embodiments of the present disclosure mayfurther provide a computer device 400. The computer device 400 includesa memory 401 and a processor 402. The memory 401 has computer readableinstructions stored thereon. When the computer readable instructions areexecuted by the processor 402, the processor 402 implements the methodfor generating a verification template according to any one of the aboveembodiments. For example, the following actions may be implemented. Atblock 01, an infrared image of a target object is obtained, and theinfrared image is stored into a trusted execution environment 511 as theinfrared template. At block 02, a laser projector 20 is controlled toproject laser light to the target object. At block 03, a laser patternmodulated by the target object is obtained. At block 04, the laserpattern is processed to obtain a depth image, and the depth image isstored into the trusted execution environment 511 as the depth template.In addition, the computer device 400 may further includes electroniccomponents such as an infrared camera 403, a visible camera 404, adisplay screen 405, and the like. The infrared camera 403 may beconfigured to collect the infrared image of the target object or thelaser pattern modulated by the target object. The visible camera 404 maybe used to collect a color image of the target object. The displayscreen 405 may be configured to display the infrared image, the colorimage, the laser pattern, etc., obtained by the processor.

As illustrated in FIG. 8, in some embodiments, the laser projector 20includes a substrate component 21, a lens cone 22, a light source 23, acollimation element 24, a diffractive optical element (DOE) 25, and aprotective cover 26.

The substrate component 21 includes a substrate 211 and a circuit board212. The circuit board 212 is disposed on the substrate 211. The circuitboard 212 is configured to couple the light source 23 to a main board ofthe terminal 100. The circuit board 212 may be a hard board, a softboard, or a combination of a soft board and a hard board. In theembodiment illustrated in FIG. 8, a through hole 2121 is defined on thecircuit board 212. The light source 23 is fixed on the substrate 211 andis electrically coupled to the circuit board 212. A heat dissipationhole 2111 may be defined on the substrate 211. Heat generated byoperation of the light source 23 or the circuit board 212 may bedissipated by the heat dissipation hole 2111. The heat dissipation hole2111 may be filled with thermal conductive adhesive, to further improveheat dissipation performance of the substrate component 21.

The lens cone 22 is fixedly coupled to the substrate component 21. Areceiving cavity 221 is defined in the lens cone 22. The lens cone 22includes a top wall 222 and an annular peripheral wall 224 extendingfrom the top wall 222. The peripheral wall 224 is disposed on thesubstrate component 21. The top wall 222 is provided with a lightthrough hole 2212 communicating with the receiving cavity 221. Theperipheral wall 224 may be coupled to the circuit board 212 by glue.

The protective cover 26 is disposed on the top wall 222. The protectivecover 26 includes a baffle 262 provided with a through hole 260 forlight exiting and an annular peripheral wall 264 extending from thebaffle 262.

Both the light source 23 and the collimation element 24 are disposed inthe receiving cavity 221. The diffractive optical element 25 is disposedon the lens cone 22. The collimation element 24 and the diffractiveoptical element 25 are disposed on a light path of light emitting of thelight source 23 successively. The collimation element 24 is configuredto collimate laser light emitted by the light source 23. The laserpasses through the collimation element 24, and then passes through thediffractive optical element 25 to form the laser pattern.

The light source 23 may be a vertical cavity surface emitting laser(VCSEL) or an edge-emitting laser (EEL). In the embodiment illustratedin FIG. 8, the light source 23 is the edge-emitting laser. In detail,the light source 23 may be a distributed feedback laser (DFB). The lightsource 23 is configured to emit laser light into the receiving cavity221. As illustrated in FIG. 9, the light source 23 is generallycolumnar. An end surface of the light source 23 away from the substratecomponent 21 forms a light emitting surface 231. The laser light isemitted from the light emitting surface 231. The light emitting surface231 faces the collimation element 24. The light source 23 is fixed onthe substrate component 21. In detail, the light source 23 may be bondedto the substrate component 21 by sealant 27. For example, a side of thelight source 23 opposite the light emitting surface 231 is bonded to thesubstrate component 21. As illustrated in FIG. 8 and FIG. 10, sidesurfaces 232 of the light source 23 may also be bonded to the substratecomponent 21. The sealant 27 may wrap around the side surfaces 232.Alternatively, only one or some of the side surfaces 232 may be bondedto the substrate component 21. At this time, the sealant 27 may be athermal conductive adhesive to transfer heat generated by the operationof the light source 23 to the substrate component 21.

As illustrated in FIG. 8, the diffractive optical element 25 is carriedby the top wall 222 and housed within the protective cover 26. Twoopposite sides of the diffractive optical element 25 are respectivelypressed against the protective cover 26 and the top wall 222. The baffle262 includes a resisting surface 2622 adjacent to the light through hole2212, and the diffractive optical element 25 is pressed against theresisting surface 2622.

In detail, the diffractive optical element 25 includes a diffractiveincident plane 252 and a diffractive emission plane 254 opposite to eachother. The diffractive optical element 25 is carried by the top wall222. The diffractive emission plane 254 is pressed against a surface(i.e. the resisting surface 2622) adjacent to the light through hole2212 of the baffle 262. The diffractive incident plane 252 is pressedagainst the top wall 222. The light through hole 2212 is aligned withthe receiving cavity 221, and the through hole 260 for light exiting isaligned with the light through hole 2212. The top wall 222, the annularperipheral wall 264, and the baffle 262 are pressed against thediffractive optical element 25, thereby preventing the diffractiveoptical element 25 from falling out of the protective cover 26 in alight exiting direction. In some embodiments, the protective cover 26 isbonded to the top wall 222 by glue.

The light source 23 of above laser projector 20 adopts the edge emittinglaser. On the one hand, a temperature shift of the edge emitting laseris smaller than that of the VCSEL array. On the other hand, since theedge emitting laser is a single-point light emitting structure, it isnot necessary to design an array structure, which is easy tomanufacture, and the light source of the laser projector 20 is low incost.

When the laser of the distributed feedback laser is propagated, thepower gained is obtained through feedback of a grating structure. Toincrease the power of the distributed feedback laser, the injectioncurrent may be increased and/or the length of the distributed feedbacklaser may be increased. As the injection current increases, the powerconsumption of the distributed feedback laser increases and a problem ofserious heating may be generated. Therefore, in order to ensure that thedistributed feedback laser can work normally, the length of thedistributed feedback laser may be increased, resulting in a distributedfeedback laser generally having a slender structure. When the lightemitting surface 231 of the edge emitting laser faces the collimationelement 24, the edge emitting laser is placed vertically. Since the edgeemitting laser has a slender structure, the edge emitting laser is proneto accidents such as dropping, shifting or shaking, and thus the settingof the sealant 27 is capable to hold the edge emitting laser and toprevent accidents such as dropping, displacement or shaking of theedge-emitting laser.

As illustrated in FIG. 8 and FIG. 11, in some embodiments, the lightsource 23 may also be fixed to the substrate component 21 in a fixedmanner illustrated in FIG. 11. In detail, the laser projector 20includes a plurality of support blocks 28. The plurality of supportblocks 28 may be fixed to the substrate component 21. The plurality ofsupport blocks 28 collectively surrounds the light source 23. The lightsource may be mounted directly between the plurality of support blocks28 during installation. In one example, the plurality of support blocks28 collectively clamps the light source 23 to further prevent the lightsource 23 from shaking.

In some embodiments, the protective 26 may be omitted. At this time, thediffractive optical element 25 may be disposed in the receiving cavity221, and the diffractive emission plane 254 of the diffractive opticalelement 25 may be pressed against the top wall 222. The laser lightpasses through the diffractive optical element 25 and then passesthrough the light through hole 2212. Thus, the diffractive opticalelement 25 is less likely to fall off.

In some embodiments, the substrate 211 may be omitted and the lightsource 23 may be directly bonded to the circuit board 212 to reduceoverall thickness of the laser projector 20. Reference throughout thisspecification to “an embodiment,” “some embodiments,” “an example,” “aspecific example,” or “some examples,” means that a particular feature,structure, material, or characteristic described in connection with theembodiment or example is included in at least one embodiment or exampleof the present disclosure. Thus, the appearances of the phrases such as“in some embodiments,” “in one embodiment”, “in an embodiment”, “inanother example,” “in an example,” “in a specific example,” or “in someexamples,” in various places throughout this specification are notnecessarily referring to the same embodiment or example of the presentdisclosure. Furthermore, the particular features, structures, materials,or characteristics may be combined in any suitable manner in one or moreembodiments or examples. Without a contradiction, the differentembodiments or examples and the features of the different embodiments orexamples can be combined by those skilled in the art.

In addition, terms such as “first” and “second” are used herein forpurposes of description and are not intended to indicate or implyrelative importance or significance or to imply the number of indicatedtechnical features. Thus, the feature defined with “first” and “second”may comprise one or more of this feature. In the description of thepresent disclosure, “a plurality of” means two or more than two, such astwo or three, unless specified otherwise.

Any process or method described in a flow chart or described herein inother ways may be understood to include one or more modules, segments orportions of codes of executable instructions for achieving specificlogical functions or steps in the process, and the scope of a preferredembodiment of the present disclosure includes other implementations,which should be understood by those skilled in the art. It is understoodthat the order of execution may differ from that which is depicted. Forexample, the order of execution of two or more boxes may be scrambledrelative to the order shown.

The logic and/or step described in other manners herein or shown in theflow chart, for example, a particular sequence table of executableinstructions for realizing the logical function, may be specificallyachieved in any computer readable medium to be used by the instructionexecution system, device or equipment (such as the system based oncomputers, the system comprising processors or other systems capable ofobtaining the instruction from the instruction execution system, deviceand equipment and executing the instruction), or to be used incombination with the instruction execution system, device and equipment.As to the specification, “the computer readable medium” may be anydevice adaptive for including, storing, communicating, propagating ortransferring programs to be used by or in combination with theinstruction execution system, device or equipment. More specificexamples of the computer readable medium comprise but are not limitedto: an electronic connection (an electronic device) with one or morewires, a portable computer enclosure (a magnetic device), a randomaccess memory (RAM), a read only memory (ROM), an erasable programmableread-only memory (EPROM or a flash memory), an optical fiber device anda portable compact disk read-only memory (CDROM). In addition, thecomputer readable medium may even be a paper or other appropriate mediumcapable of printing programs thereon, this is because, for example, thepaper or other appropriate medium may be optically scanned and thenedited, decrypted or processed with other appropriate methods whennecessary to obtain the programs in an electric manner, and then theprograms may be stored in the computer memories.

It should be understood that each part of the present disclosure may berealized by the hardware, software, firmware or their combination. Inthe above embodiments, a plurality of steps or methods may be realizedby the software or firmware stored in the memory and executed by theappropriate instruction execution system. For example, if it is realizedby the hardware, likewise in another embodiment, the steps or methodsmay be realized by one or a combination of the following techniquesknown in the art: a discrete logic circuit having a logic gate circuitfor realizing a logic function of a data signal, an application-specificintegrated circuit having an appropriate combination logic gate circuit,a programmable gate array (PGA), a field programmable gate array (FPGA),etc.

Those skilled in the art shall understand that all or parts of the stepsin the above exemplifying method of the present disclosure may beachieved by commanding the related hardware with programs. The programsmay be stored in a computer readable storage medium, and the programscomprise one or a combination of the steps in the method embodiments ofthe present disclosure when run on a computer.

In addition, individual functional units in the embodiments of thepresent disclosure may be integrated in one processing module or may beseparately physically present, or two or more units may be integrated inone module. The integrated module as described above may be achieved inthe form of hardware, or may be achieved in the form of a softwarefunctional module. If the integrated module is achieved in the form of asoftware functional module and sold or used as a separate product, theintegrated module may also be stored in a computer readable storagemedium.

The above-mentioned storage medium may be a read-only memory, a magneticdisc, an optical disc, etc. Although explanatory embodiments have beenshown and described, it would be appreciated by those skilled in the artthat the above embodiments cannot be construed to limit the presentdisclosure, and changes, alternatives, and modifications can be made inthe embodiments without departing from spirit, principles and scope ofthe present disclosure.

What is claimed is:
 1. A method for generating a verification template,the verification template comprising an infrared template and a depthtemplate, and the method comprising: obtaining an infrared image of atarget object and storing the infrared image into a trusted executionenvironment as the infrared template; controlling a laser projector toproject laser light to the target object; obtaining a laser patternmodulated by the target object; and processing the laser pattern toobtain a depth image and storing the depth image into the trustedexecution environment as the depth template.
 2. The method according toclaim 1, further comprising: obtaining a color image of the targetobject and storing the color image into a rich execution environment;and obtaining the color image from the rich execution environment andcontrolling a display screen to display the color image.
 3. The methodaccording to claim 1, wherein obtaining the laser pattern modulated bythe target object comprises obtaining a plurality of laser patternframes modulated by the target object and processing the laser patternto obtain the depth image comprises: processing each of the plurality oflaser pattern frames to obtain a plurality of initial depth imageframes; and combining the plurality of initial depth image frames toobtain the depth image.
 4. The method according to claim 3, wherein theplurality of initial depth image frames are obtained from a plurality ofdifferent angles.
 5. The method according to claim 1, wherein codes anda memory area in the trusted execution environment are controlled by anaccess control unit and are inaccessible to programs in the richexecution environment.
 6. A system for generating a verificationtemplate, wherein the verification template comprises an infraredtemplate and a depth template, the system comprises a microprocessor andan application processor, and the microprocessor is configured to:obtain an infrared image of a target object and store the infrared imageinto a trusted execution environment as the infrared template; control alaser projector to project laser light to the target object; obtain alaser pattern modulated by the target object; and process the laserpattern to obtain a depth image and store the depth image into thetrusted execution environment as the depth template.
 7. The systemaccording to claim 6, wherein the application processor is configuredto: obtain a color image of the target object and store the color imageinto a rich execution environment; and obtain the color image from therich execution environment and control a display screen to display thecolor image.
 8. The system according to claim 6, wherein themicroprocessor is configured to: obtain a plurality of laser patternframes modulated by the target object; process each of the plurality oflaser pattern frames to obtain a plurality of initial depth imageframes; and combine the plurality of initial depth image frames toobtain the depth image.
 9. The system according to claim 8, wherein theplurality of initial depth image frames are obtained from a plurality ofdifferent angles.
 10. The system according to claim 6, wherein themicroprocessor is coupled to the trusted execution environment via amobile industry processor interface.
 11. The system according to claim6, wherein codes and a memory area in the trusted execution environmentare controlled by an access control unit and are inaccessible toprograms in the rich execution environment.
 12. A terminal forgenerating a verification template, wherein the verification templatecomprises an infrared template and a depth template, the terminalcomprising: an infrared camera, configured to collect an infrared imageof a target object; a laser projector, configured to project laser lightto the target object; a microprocessor; and an application processor,the microprocessor is configured to: obtain the infrared image of thetarget object and store the infrared image into a trusted executionenvironment as the infrared template; control the laser projector toproject the laser light to the target object; obtain a laser patternmodulated by the target object; and process the laser pattern to obtaina depth image and store the depth image into the trusted executionenvironment as the depth template.
 13. The terminal according to claim12, wherein the application processor is configured to: obtain a colorimage of the target object and store the color image into a richexecution environment; and obtain the color image from the richexecution environment and control a display screen to display the colorimage.
 14. The terminal according to claim 12, wherein themicroprocessor is configured to: obtain a plurality of laser patternframes modulated by the target object; process each of the plurality oflaser pattern frames to obtain a plurality of initial depth imageframes; and combine the plurality of initial depth image frames toobtain the depth image.
 15. The terminal according to claim 14, whereinthe plurality of initial depth image frames are obtained from aplurality of different angles.
 16. The terminal according to claim 12,wherein the microprocessor is coupled to the trusted executionenvironment via a mobile industry processor interface.
 17. The terminalaccording to claim 12, wherein codes and a memory area in the trustedexecution environment are controlled by an access control unit and areinaccessible to programs in the rich execution environment.
 18. Theterminal according to claim 12, wherein the microprocessor is coupled tothe infrared camera, and the microprocessor is coupled to the laserprojector.
 19. The terminal according to claim 12, further comprising:an infrared fill lamp, configured to emit infrared light, and be coupledto the application processor.